import React from "react";
import { RouteObject } from "react-router";
import Home from "@pages/Home";
import Use from "@pages/use";
import Figment from "@pages/figment";
import Koa from "@pages/Koa";
import Demo from "./pages/Demo";
import LessCode from "./pages/LessCode";
import Preview from "./pages/LessCode/Preview";
import Com from "./pages/Com/index";
export interface ExtraBizObject {
  name?: string;
  children?: Array<MyRouter>;
  show: boolean;
}
export type MyRouter = ExtraBizObject & RouteObject;

export const router: Array<MyRouter> = [
  {
    name: "",
    path: "/",
    show: true,
    element: <Home />, //Home,
    // element: <Koa />,
  },
  {
    name: "Draw",
    path: "draw",
    show: true,
    element: <Figment />,
  },
  {
    name: "Koa",
    path: "koa",
    show: true,
    element: <Koa />,
  },
  {
    name: "Demo",
    path: "Demo",
    show: true,
    element: <Demo />,
  },
  {
    name: "Com",
    path: "com",
    show: true,
    element: <Com />,
  },
  {
    name: "lessCode",
    path: "lessCode",
    show: true,
    element: <LessCode />,
  },
  {
    name: "lessCode_View",
    path: "/lessCode/view/:id",
    show: false,
    element: <Preview />,
  },
];
